<?php
class showproject extends controller{
	public function __construct($url){
		parent::__construct($url, true);
	}

	public function check(){
		if(!isset($this->url[1]) || empty($this->url[1])) $this->redirect("start", "A megadott projekt nem létezik!");
		$sql = "SELECT id FROM project WHERE link='".$this->url[1]."'";
		if($this->database->fetchRow($sql) == null) $this->redirect("start", "A megadott projekt nem létezik!");
	}

	public function run(){
		header("Location: http://marketingman.hu/projects/".$this->url[1]."/");
	}
}
?>
